﻿//---------------------------------------------------------------------
// Copyright (c) 2007 Digerati Technologies, LLC.  All Rights Reserved.
//
// Release under the Microsoft Public License (Ms-PL).
//---------------------------------------------------------------------

using System.Windows.Forms;

namespace DigeratiTech.NDiagnostics
{
    /// <summary>
    /// This class provides the About dialog for the NDiagnostics application.
    /// </summary>
    public partial class About : Form
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="About"/> class.
        /// </summary>
        public About()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Initializes the form.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void About_Load(object sender, System.EventArgs e)
        {
            System.Version version = System.Reflection.Assembly.GetEntryAssembly().GetName().Version;

            lblVersion.Text = string.Format("Version {0}", version);

            // A Revision != 0 signifies a "beta" release
            if (version.Revision > 0)
            {
                lblVersion.Text += " Beta";
            }
        }

        /// <summary>
        /// Launches the selected link in the default web browser.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.Forms.LinkLabelLinkClickedEventArgs"/> instance containing the event data.</param>
        private void lnkCodePlex_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            System.Diagnostics.Process.Start(lnkCodePlex.Text);
        }
    }
}
